﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Yule8xCommon.Applib;
using Yule8xCommon.Db;

namespace Yule8xModel
{
    public class GameManufacturerModels
    {
        public static GameManufacturerModel GetEntity(int id)
        {
            GameManufacturerModel model = null;
            string sqlstmt = string.Format("select top 1 id, game_name, mact_code, default_currency_name, icon_url from t_game_manufacturer where id={0}", id);
            DataTable dtItem=DbFactory.Init(AppInfo.conn_yule8x_agent).ExecuteDataTable(sqlstmt);
            if (dtItem.Rows.Count > 0)
            {
                model = new GameManufacturerModel();
                model.default_currency_name = DataTableUtil.GetString(dtItem, "default_currency_name");
                model.game_name = DataTableUtil.GetString(dtItem, "game_name");
                model.icon_url = DataTableUtil.GetString(dtItem, "icon_url");
                model.id = DataTableUtil.GetInteger(dtItem, "id");
                model.mact_code = DataTableUtil.GetString(dtItem, "mact_code");
            }
            return model;
        }
    }
    public class GameManufacturerModel
    {
        public int id { get; set; }
        public string mact_code { get; set; }
        public string game_name { get; set; }
        public string default_currency_name { get; set; }
        public string icon_url { get; set; }
    }
}
